package game.renderer.Denis;

import game.enums.BlockID;
import game.enums.Direction;
import game.enums.FloorID;
import game.enums.PlayerState;

public class IndexResolver {
    
    public static int getFieldIndex(FloorID value) {
		switch (value) {
		case DIRT:
			return 1;
		case GRASS:
			return 2;
		case SAND:
			return 3;
		case STONE:
			return 4;
		case ICE:
			return 5;
		case LAVA:
			return 6;
		case WATER:
			return 7;
		case MARBLE:
			return 8;
		case QUICKSAND:
			return 9;
		case SWAMP:
			return 10;
		/*case GLASS:
			return 11;*/
		default:
			return 0;
		}
	}
    
    public static int getBlockIndex(BlockID value) {
		switch (value) {
		case BLOCK:
			return 101;
		default:
			return 100;
		}
	}
    
    public static int getPlayerIndex(Direction dir, PlayerState state) {
    	int buff;
		switch (state) {
		case IDLE:
			buff = 900;
			break;
		case MOVING:
			buff = 904;
			break;
		case INTERACT:
			buff = 912;
			break;
		/*case PUSH:
			buff = 916;
			break;
		case PULL:
			buff = 924;
			break;
		case USEITEM:
			buff = 932;
			break;
		case DEAD:
			buff = 936;
			break;*/
		default:
			return 0;
		}
		switch (dir) {
		case UP:
			buff += 0;
			break;
		case RIGHT:
			buff += 1;
			break;
		case DOWN:
			buff += 2;
			break;
		case LEFT:
			buff += 3;
			break;
		default:
			return 0;
		}
		return buff;
	}
}
